#ifndef MINI_ENGINE_GAMEOBJECT
#define MINI_ENGINE_GAMEOBJECT
#include "Model.h"
#include <memory>

namespace mini_engine
{

    struct Transform2dComponent
    {
        glm::vec2 translationP{};
        glm::mat2 mat2(){return glm::mat2{1.f};}
    };
    

    class GameObject
    {
    public:
        using id_t = unsigned int;
        static GameObject createGameObject()
        {
            static id_t currentId = 0;
            return GameObject{currentId++};
        }
        id_t getId() { return id; }

        shared_ptr<Model> model{};
        glm::vec3 color{};
        Transform2dComponent transform2d{};

        /**
         * 禁止GameObject类的拷贝构造和拷贝赋值，而允许其移动构造和移动赋值
        */
        GameObject(const GameObject &) = delete;
        GameObject &operator = (const GameObject &) = delete;
        GameObject(GameObject &&) = default;
        GameObject &operator = (GameObject &&) = default;


    private:
        id_t id;
        GameObject(id_t obgId) : id{obgId} {};
    };
}

#endif